package com.qunar.wan.common_api.model;

import com.qunar.wan.common_api.DateUtil;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * User: huiming.suo Date: 13-11-26 Time: 下午3:02 用户评论bean
 */
public class Comment implements Serializable {
    private static final long serialVersionUID = 6612605977453930781L;
    private int id;
    private int actId;
    private int userId;
    private String userName;
    private String content;
    private String headImg;
    private Timestamp createTime;

    // 日期 时间分开 虚拟字段
    private String commentDate;
    private String commentTime;

    public String getCommentDate() {
        return DateUtil.getDay(getCreateTime());
    }

    public void setCommentDate(String commentDate) {
        this.commentDate = commentDate;
    }

    public String getCommentTime() {
        return DateUtil.getHHMM(getCreateTime());
    }

    public void setCommentTime(String commentTime) {
        this.commentTime = commentTime;
    }

    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    public String getHeadImg() {

        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

//    @JsonSerialize(using = EscapeSerializer.class)
    public String getContent() {

        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getUserName() {

        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public int getUserId() {

        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public int getActId() {

        return actId;
    }

    public void setActId(int actId) {
        this.actId = actId;
    }

    public int getId() {

        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public String toString() {
        return "Comment{" + "id=" + id + ", actId=" + actId + ", userId=" + userId + ", userName='" + userName + '\''
                + ", content='" + content + '\'' + ", headImg='" + headImg + '\'' + ", createTime=" + createTime + '}';
    }
}
